﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LanDBom
{
    public class UserAuthentication:AuthorizeAttribute
    {
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            if (!MyAuthentication.IsLogin() || MyAuthentication.GetRighhts() != "user")
            {
                HttpContext.Current.Response.Redirect("/Home/Login", true);
            }
        }
    }
}